Dynamically setting parameters

VoiceAI Connect can populate certain bot's administrative parameters according to conversation's attributes (e.g., SIP header values). Those parameters are referred to as "placeholder" parameters.

Placeholder parameters are set when the conversation starts and cannot be changed afterward.

Currently, this is supported only for the sendMetaDataUrl parameter (see Sending metadata), enabling the use of a different URL per conversation.


How do I use it?

VoiceAI Connect handles placeholder parameters as JavaScript template literals, allowing placeholders to be specified using the dollar sign and curly braces syntax: ${}.

The placeholders are resolved ("executed") when the conversation starts (after executing the manipulation.startToBot hook).

The expression within the placeholder provides read-only access to the following variables and functions:

If the resolving of placeholders fails (due to JaveScript exception), the call is terminated.

For having access to SIP headers, the SBC must be configured to forward them to VoiceAI Connect.

Examples

Below shows examples of using placeholders to populate the URL value of the sendMetaDataUrl parameter: